package com.homework.note.Model;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 * @author htyu
 * @date 2019/3/4
 */
@Document
@Data
public class User {


    /**
     *用户id
     */
    @Id
    private String id;

    /**
     *用户姓名
     */
    @NotNull(message = "账号不可为空")
    private String name;

    /**
     *用户密码
     */
    @NotNull(message = "密码不可为空")
    @Size(min = 6,message = "密码不能少于6位")
    private String password;
}
